package com.rongke.enums;

/**
 * Created by cheetahlou on 2017/11/22.
 */
public enum MsgTypeEnum {
    INCOME_NOTICE(1,"收到提成提醒"),REFUND_COMPLETE(2,"退款完成提醒"),USERTYPE_UP(3,"身份升级祝贺"),VIP_UP(4,"VIP等级提升祝贺"),EXPERIENCE_QUESTIONAIRE(5,"试用问卷填写提醒");




    private Integer type;
    private String typeName;
    MsgTypeEnum(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }


    /**
     * 根据type 获取typeName
     * @param type
     * @return
     */
    public static MsgTypeEnum getMsgTypeNameByType(Integer type) {
        for (MsgTypeEnum userTypeEnum: values()) {
            if (userTypeEnum.getType().equals(type)) {
                return userTypeEnum;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}
